package com.iodemo;

import java.io.*;

public class Test {
    public static void main(String[] args) throws FileNotFoundException {
        OutputStream os = null; //字节流 写
        OutputStreamWriter osw = null; // 字符流
        BufferedWriter bw = null; // 缓冲流

        try {
            os = new FileOutputStream("/Users/edy/Desktop/file/3.txt");
            osw = new OutputStreamWriter(os);
            bw = new BufferedWriter(osw);
            bw.write("我是中国人");
            bw.newLine(); // 换行
            bw.flush(); // 一次性写入
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            IOUntilsDemo.close(os);
        }
    }
}
